<?php

namespace app\storeapi\validate;

use think\Validate;

class Store extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        // 门店id
        'shop_id' =>['require'],
        // 门店名称
        'shop_name' => ['require'],
        // 门店logo图片id
        'logo_image_id' => ['require'],
        // 联系电话
        'phone' => ['require'],

    ];

    protected $message  =   [
        'shop_id.require'        => '店铺ID不能为空',
        'shop_name.require'   => '店铺名称不能为空',
        'logo_image_id.require'   => '请上传图片',
        'phone.require'        => '店铺电话不能为空',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'storeInfo' => ['shop_id'],
        'editInfo' => ['shop_id','shop_name','logo_image_id', 'phone'],
    ];

}
